#include "Utility.h"

std::vector<std::string>& Utility::split(const std::string &s, char delim, std::vector<std::string> &elems)
{
	std::stringstream ss(s);
	std::string item;
	while (std::getline(ss, item, delim))
	{
		elems.push_back(item);
	}
	return elems;
}

std::vector<std::string> Utility::split(const std::string &s, char delim)
{
	std::vector<std::string> elems;
	return split(s, delim, elems);
}

LPWSTR Utility::convertStringToLPWSTR(string str)
{
	std::string tmp = str;
	LPWSTR appParams = new wchar_t[tmp.size() + 1];
	copy(tmp.begin(), tmp.end(), appParams);
	appParams[tmp.size()] = 0;
	return appParams;
}